//快速生成一个接口，在建立的时候，在最开始的地方，使用sercice.studentservice(这样会生成包service)
package cn.edu.ctbu.lab.service;

import cn.edu.ctbu.lab.domain.Student;
import cn.edu.ctbu.lab.domain.Teacher;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public interface TeacherService {

    Optional<Teacher> findById(Integer id);
    List<Teacher> findAll();
    Page<Teacher> findByPage(int pageIndex, int pageSize);
    Teacher add(Teacher Teacher);
    Teacher update(Teacher Teacher);
    int delete(Teacher Teacher);
    int delete(Integer id);

    /**
     *
     * @param name
     * @param password
     * @return
     * @throws Exception
     */
    Teacher validUserNoAndPassword(String name,String password)  throws  Exception;
    List<Teacher> findByNameAndPage(String name);
}
